<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Voyager Backend - User Management</title>
<script type="text/javascript" src="../lib/angular/angular.min.js"></script>
<script src="http://code.angularjs.org/1.2.1/angular-route.min.js"></script>
<link rel="stylesheet" type="text/css" href="../app/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css"
	href="../app/css/bootstrap-responsive.min.css">
<link rel="stylesheet" type="text/css" href="../app/css/main.css">
<link rel="stylesheet" type="text/css"
	href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
</head>
<body ng-app="myApp">


		<div class="container" data-ng-init="init()">
			<div class="main row">
				<div class="col-xs-3">
					<ul class="list-group">
						<li class="list-group-item"><a href="#/home"> <span
								class="glyphicon glyphicon-home"></span></a></li>

						<li ng-repeat="item in menu" class="list-group-item"><a
							href="{{item.href}}"> {{item.link}}</a></li>
                        <li class="list-group-item"><a href="#" ng-click="logout()"> <span
								class="glyphicon glyphicon-log-out"></span></a></li>
	                 </ul>
				</div>
				<div class="col-xs-9 panel panel-default">
					<div ng-show="list_user_visible(1)">
						<caption>
							<h1>List of users</h1>
						</caption>

                        <div class="col-sm-2" style="padding-left:0px;">Search user :</div>
                        <div class="col-sm-10" style="padding-left:0px;"><input type="text" ng-model="search1" ng-change="filter()"
									 placeholder="Search"></div>
                        
                       <!-- 
						<table border="0">
								 
                          <tr>
								<td>Users who registered:</td>
								<td><select ng-model="search1"
									ng-options="c.time_ for c in filter_day">
										<option value="">-- choose time --</option>
								</select></td>
							</tr>
                               

							<tr>
								<td>Enter name:</td>
								<td><input type="text" ng-model="search1"
									ng-change="filter()" placeholder="Search"></td>
							</tr>
						</table>-->


						<table class="table table-striped">

							<thead>
								<tr>
									<th>Login Id</th>
									<th>First Name</th>
									<th>Last Name</th>
									<th>Email</th>
									<th>Active</th>
									<th>View</th>
								</tr>
							</thead>
							<tbody>
								<!--	<tr
									ng-repeat="v in a | filter:personFilter|  filter: search1"
									ng-click="go(v[4],0)" class="tr">   ng-click="go(v[4],0)"  class="tr"-->

								<tr
									ng-repeat="v in filtered = (a | filter:search1 ) |  startFrom:(currentPage-1)*entryLimit | limitTo:entryLimit"
									class="tr" >


									<td>{{v[0]}}</td>
									<td>{{v[1]}}</td>
									<td>{{v[2]}}</td>
									<td>{{v[3]}}</td>
									<td>
                                         <div ng-switch on="v[6]">
											<div ng-switch-when="1">
											   <span class="glyphicon glyphicon-remove"></span>
											</div>
											<div ng-switch-when="0">
											   <span class="glyphicon glyphicon-ok"></span>
											</div>
										</div>
                                     </td>
                                     
                                    <td><a href="#/user_detail/{{v[4]}}" > <span
											class="glyphicon glyphicon-arrow-right"></span>
										</a> 
										</td>
											
								<!--ng-click="go(v[4],0,1)"     ng-click="go(v[4],0,1)"
								    <td>
                                       <div ng-switch on="v[6]" class="tr">
											<div ng-switch-when="1" >
											    <span class="glyphicon glyphicon-thumbs-up" ng-click="lock(v[4],1)"></span>
											</div>
											<div ng-switch-when="0" >
											    <span class="glyphicon glyphicon-thumbs-down" ng-click="lock(v[4],0)"></span>
											</div>
										</div>
                                     </td> -->
								</tr>

							</tbody>
						</table>

						<div>

							<nav>
								<ul class="pager">
									<li ng-hide="disablePrev" id="nav"><a href="#/user"
										ng-click="previousPage()">Previous</a></li>
									<li ng-hide="disableNext" id="nav1"><a href="#/user"
										ng-click="nextPage()">Next</a></li>
								</ul>
							</nav>


							<pagination data-boundary-links="true" data-num-pages="noOfPages"
								data-current-page="currentPage" max-size="maxSize"
								class="pagination-small" data-previous-text="&laquo;"
								data-next-text="&raquo;"></pagination>

						</div>



						<!-- 
					  <ul class="pagination">
					    <li  ng-hide="disablePrev"><a href="#" ng-click="previousPage()" >&laquo;</a></li>
					    <li><a href="#">1</a></li>
					    <li><a href="#">2</a></li>
					    <li><a href="#">3</a></li>
					    <li><a href="#">4</a></li>
					    <li><a href="#">5</a></li>
					    <li ng-hide="disableNext"><a href="#"  ng-click="nextPage()">&raquo;</a></li>
					  </ul>  -->
					</div>

					<div ng-show="is(0)">
						<caption>
							<h1>User detail</h1>
						</caption>
						<div class="form-group">
							<label class="col-sm-9 control-label"></label>
							<div class="col-sm-3">
								<p class="form-control-static">
									<a href="#/user" ng-click="return_(null,1)"> <span
										class="glyphicon glyphicon-arrow-left"></span></a>
								</p>
							</div>
						</div>

                       <div class="form-group">
							<label class="col-sm-2 control-label"  id="label">Last Name</label>
							<div class="col-sm-10">
								<p class="form-control-static" style="padding-top: 0px;">{{user.data.last_name}}</p>
							</div>
						</div>
						
						<div class="form-group">
							<label class="control-label col-sm-2"  id="label">First Name</label>
							<div class="col-sm-10">
								<p class="form-control-static" style="padding-top: 0px;">{{user.data.first_name}}</p>
							</div>
						</div>


						

						<div class="form-group">
							<label class="col-sm-2 control-label"  id="label">Email</label>
							<div class="col-sm-10">
								<p class="form-control-static" style="padding-top: 0px;">{{user.data.email}}</p>
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-2 control-label"  id="label">Login Type</label>
							<div class="col-sm-10">
								<p class="form-control-static" style="padding-top: 0px;">{{user.data.login_type}}</p>
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-2 control-label"  id="label" style="padding-top: 5px;">Status</label>
							<div class="col-sm-10">

 									  <div ng-switch on="user.data.blocked_flg" style="padding-top: 0px;">
											<div ng-switch-when="1"  >Inactive 
											  <button type="button" class="btn btn-success" confirmed-click="lock(user.data.id,1)" ng-confirm-click="Would you like to unlock this user?"> UnLock</button>
                                      
											</div>
											<div ng-switch-when="0" >Active   
											 <button type="button" class="btn btn-danger" confirmed-click="lock(user.data.id,0)" ng-confirm-click="Would you like to lock this user?">Lock</button>
											   
											</div>
										</div>
 
                               		  <p class="" style="padding-top: 0px;" >
                                      </p>
                                      
							</div>

                          </div>

						<div class="form-group">
							<label class="col-sm-2 control-label"  id="label">Avatar</label>
							<div class="col-sm-10">
								<p class="form-control-static" style="padding-top: 0px;">
									<img src="{{user.data.avatar_url}}" class="img-responsive"
										alt="{{user.data.first_name}}">
								</p>
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-2 control-label"  id="label">Interests</label>
							<div class="col-sm-10">
								<p class="form-control-static" style="padding-top: 0px;">
									<!-- 
							  <ul class="class="list-group">
							  
							      <li ng-repeat="item in user.data.interests" class="list-group-item list-group-item-success"> {{item}}  </li>
							    
							  </ul>  -->


									<span data-ng-repeat="item in user.data.interests">{{item}}<span
										ng-show="!$last">, </span></span>

								</p>
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-2 control-label"  id="label">Groups</label>
							<div class="col-sm-10"
								style="padding-left: 0px; padding-top: 0px;">

								<ul class="list-group" style="margin-left: 13px;"">
                                   <!-- 
									<li ng-repeat="item in groups.data.groups_list"
										class="list-group-item" style="width: 70%"><a href="#"
										ng-click="group_go(item.id,1)">{{item.name}} - {{item.id}}
									</a></li> -->
                                    
                                    <li ng-repeat="item in b"
										class="list-group-item" style="width: 70%"><a href="#/user"
										ng-click="group_go(item[1],1,user.data.id)">{{item[0]}} - {{item[1]}}
									</a></li>
								</ul>

							</div>
							
							<div>

								 <nav>
									<ul class="pager">
										<li ng-hide="disablePrev_group" id="anchor"><a href="#/user"
											ng-click="previousPage_group()">Previous</a></li>
										<li ng-hide="disableNext_group" id="anchor"><a href="#/user"
											ng-click="nextPage_group()">Next</a></li>
									</ul>
								</nav>

						    </div>
						      
						</div>





					</div>

					<div ng-show="group_detail_visible(1)">
						<caption>
							<h1>Group detail</h1>
						</caption>
						<div class="form-group">
							<label class="col-sm-8 control-label"></label>
							<div class="col-sm-4">
								<p class="form-control-static">
									<a href="#/user" ng-click="return_user_detail(null,1)"> <span
										class="glyphicon glyphicon-arrow-left"></span></a>
								</p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label"  id="label">Group name</label>
							<div class="col-sm-10">
								<p class="form-control-static" style="padding-top: 0px;">{{group.data.name}}</p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label"  id="label">Description</label>
							<div class="col-sm-10">
								<p class="form-control-static" style="padding-top: 0px;">{{group.data.description}}</p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label"  id="label">Interest</label>
							<div class="col-sm-10">
								<p class="form-control-static" style="padding-top: 0px;">{{group.data.interest}}</p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label"  id="label">Address</label>
							<div class="col-sm-10">
								<p class="form-control-static" style="padding-top: 0px;">{{group.data.address}}</p>
							</div>
						</div>

                       <div class="form-group">
							<label class="col-sm-2 control-label"  id="label">Location</label>
							<div class="col-sm-10">
								<p class="form-control-static" style="padding-top: 0px;">
                                  <iframe width="300" height="170" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps?q={{long}},{{lat}}&hl=es;z=14&amp;output=embed"></iframe><br />
                                   
                               </p>
							</div>
						</div>

                        

                      <div class="form-group">
							<label class="col-sm-2 control-label"  id="label">Public</label>
							<div class="col-sm-10">
								
								<div ng-switch on="group.data.privacy">
											<div ng-switch-when="1">
											   <span class="glyphicon glyphicon-ok"></span>
											   
											</div>
											<div ng-switch-default>
											   <span class="glyphicon glyphicon-remove"></span>
											</div>
										</div>
								<p class="" style="padding-top: 0px;"> 
								</p>
							</div>
						</div>

                       <div class="form-group">
                          <label class="col-sm-2 control-label"  id="label">
                           <div ng-switch on="group.data.privacy">
                               <div ng-switch-when="1">
                                  Searchable
                               </div>
                               <div ng-switch-default>
                               </div>
                           </div>
                         </label> 
							
							<div class="col-sm-10">
								
									<div ng-switch on="group.data.privacy">
											<div ng-switch-when="1">
											    <div ng-switch on="group.data.searchable">
										         	 <div ng-switch-when="1">
											            <span class="glyphicon glyphicon-ok"></span>
											   
											         </div>
											        <div ng-switch-default>
											            <span class="glyphicon glyphicon-remove"></span>
											         </div>
										         </div>
											   
											</div>
											<div ng-switch-default>
											  
											</div>
										</div>
								   
								   

                                      
								<p class="" style="padding-top: 0px;"> 
								</p>
							</div>
						</div>
						
						<div class="form-group">
							<label class="col-sm-2 control-label"  id="label">Owner</label>
							<div class="col-sm-10">
								<p class="form-control-static" style="padding-top: 0px;">

									<a href="#/user" ng-click="go(user.data.id,0,2)"><i class="fa fa-shield"></i>
										{{user.data.first_name}} {{user.data.last_name}}</a>
								</p>
							</div>
						</div>
						
							<div class="form-group">
							<label class="col-sm-2 control-label"  id="label">List of {{nb_users}} member(s)</label>
							<div class="col-sm-10"
								style="padding-left: 0px; padding-top: 0px;">

								<ul class="list-group" style="margin-left: 13px;"">

									<li ng-repeat="item in lst_user.data.members_list"
										class="list-group-item" style="width: 70%"><a href="#/user"
										ng-click="go(item.id,0,2)">{{item.name}} 
									</a></li>

								</ul>

							</div>
						</div>  
					</div>
				</div>
			</div>
		</div>

</body>
</html>